import { request } from '@/utils/request';

/**
 * @description 获取table列表
 */
export function getTableListApi(data?: API.SearchParams) {
  return request({
    url: '/manage/admin/dept/pageList',
    method: 'post',
    data,
  });
}

/**
 * @description 编辑机构
 */
//
export function updateDept(data: API.UpdateUserParams) {
  return request({
    url: '/manage/admin/dept/edit',
    method: 'put',
    data,
  });
}

/**
 * @description 新增机构
 */
//
export function createDept(data: API.CreateUserParams) {
  return request({
    url: '/manage/admin/dept/add',
    method: 'post',
    data,
  });
}

/**
 * @description 获取机构详情
 */
//
export function getDetailOragn(oragnId: string) {
  return request({
    url: `/manage/admin/dept/detail/${oragnId}`,
    method: 'get',
  });
}

/**
 * @description 删除机构
 */
//
export function deleteDeptApi(id?: string) {
  return request({
    url: `/manage/admin/dept/delete/${id}`,
    method: 'delete',
  });
}
